package interceptors

import (
	"aquaman/app/infra/job"
	"context"
	"github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap"
	"go.uber.org/zap"
)

func CtxZapInterceptor(logger *zap.Logger) job.TaskInterceptor {
	return func(next job.Task) job.Task {
		return func(ctx context.Context) error {
			newCtx := ctxzap.ToContext(ctx, logger)
			return next(newCtx)
		}
	}
}
